package org.tsing.mybatis_p.controller;

import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.tsing.mybatis_p.domain.User;
import org.tsing.mybatis_p.mapper.UserMapper;

/**
 * @Date 2023/10/26 16:38
 */

@RestController
@RequestMapping("/mp")
public class MyController {
    @Autowired
    UserMapper mapper;
    @GetMapping("/query")
    public String query(int id){
        User user = mapper.query(id);
        return JSON.toJSONString(user);
    }
}
